<?
### need for static event page

if($_SERVER['REDIRECT_URL']=='/events/engine'):

?>
<article id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
<?=l($node->title,'node/'.$node->nid);?>
</article>
<?
else:
?>
<?php if (!$page): 
    
  
    ?>
    <article id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
    <?php endif;
    
     $breadcrumb=drupal_get_breadcrumb();
     $breadcrumb[]=l('Афиша','events'); 
    $results = db_query('SELECT tid FROM {taxonomy_index} WHERE nid = :nid', array(':nid' => $node->nid));
    foreach ($results as $result) {
      $term = taxonomy_term_load($result->tid);
      
      if(($term->vid==8)&&($term->tid!=111)&&($term->tid!=157)){$breadcrumb[]=l($term->name,'events',array('query'=>array('tid'=>$term->tid)));break;}
    }
   $breadcrumb[]='<strong>'.$node->title.'</strong>';
    echo "<div class='breadcrumb'>".implode(" &raquo; ",$breadcrumb)."</div>";
    ?>
	
    <h1 class="title"><?php print $node->title; ?></h1>

    <div class="event_area">

		<div class="info_thumb">
		<?=_spec_events_schedule_imgs4event($node);
		#pre($node);
		/*
		?>
			<?php if (isset($content['field_event_thumbnail']['#items']) && count($content['field_event_thumbnail']['#items'])) : ?>
				<?php foreach ($content['field_event_thumbnail']['#items'] as $i) : ?>
					<div class="thumb"><a class="fancybox" title="<?=str_replace('"','`',htmlspecialchars($node->title));?>" href="<?php echo image_style_url('large', $i['uri']); ?>" rel="gallery"><img src="<?php echo image_style_url('w150', $i['uri']); ?>" alt="<?=str_replace('"','`',htmlspecialchars($node->title));?>"  title="<?=str_replace('"','`',htmlspecialchars($node->title));?>" /><div class="ugolok"></div></a></div>
				<?php endforeach; ?>
			<?php else : ?>
				<div class="thumb"></div>
			<?php endif; */?>
            <?php/* if (isset($content['field_event_buy_a_ticket']['#items'][0]['value'])

                    && $content['field_event_buy_a_ticket']['#items'][0]['value'] == 1
                    ) : ?>

			<div class="info">
				<table class="short_info">

				   	<tr>

                    <?php if (isset($content['field_event_ticket_id']['#items'][0]['value'])
                                && trim($content['field_event_ticket_id']['#items'][0]['value']) != ""
                    ) : 
					
                    endif; ?>

                    <?php if (isset($content['field_event_ticket_type2_id']['#items'][0]['value'])
                                && trim($content['field_event_ticket_type2_id']['#items'][0]['value']) != ""
                    ) : ?>
                        <td colspan="2">
							<a class="ticketstream_butt" id="ticketstream_butt_2" target="_blank" href=>Заказать Билет</a>
				        </td>
                    <?php endif; ?>
				    </tr>

				</table>
			</div>
            <?php endif; */?>
<?php if (user_access('bypass node access')) : ?>
            <div class="admin-link1">
            <?php echo l('Редактировать', 'node/' . $node->nid . '/edit'); ?>
            </div>
        <?php endif; 
		
		?>
		</div>
		<div class="full_content">
        	<?
                global $infopark;
                
                //print $node->field_videoid['und'][0]['value']
                echo $infopark->draw_video_nodes($node->field_videoid['und'][0]['value']);
              
                 echo $infopark->draw_additional_images($content['field_event_images']['#items']);
		## связь с новостью
	#	echo _advert_comp_news_link($node->nid); 
		/* ?>            
        <?php if (isset($content['field_event_images']['#items']) && count($content['field_event_images']['#items'])) : ?>
            <?php foreach ($content['field_event_images']['#items'] as $i) : ?>
               - <a class="fancybox" rel="gallery" href="<?php echo image_style_url('large', $i['uri']); ?>" title="<?php echo htmlspecialchars($i['title']) ?>"><img src="<?php echo image_style_url('50_50', $i['uri']); ?>" /></a>
            <?php endforeach; ?>
            <br /><br />
        <?php endif; */?>

                    
		<div class="gallery_list_wrapper">
		        <?php $gallery_package_array = get_gallery_package_by_node_id($node->nid);?>
		        <?php
		        foreach ($gallery_package_array as $gallery_package_id) :?>
		        <?php $gallerys_list = get_gallery_liste_by_package_id($gallery_package_id->tid);?>
		        <?php
		         foreach ($gallerys_list as $gallery) :
		
		
		          $image_list = get_img_list_by_gallery_id($gallery->nid);?>
		
		<script>
		
		
		            jQuery(function () {
		
					jQuery("#gallery_<?php echo $gallery->nid;?>").click(function() {
						jQuery.fancybox.open([
		
		
		
		
		                <?php foreach ($image_list as $image) :  ?>
		
		                                {
		                                                                        scrolling : 'auto',
		                                    tpl: {
		                                    wrap     : '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><table class="img_comments"><tr><td><div class="fancybox-inner"></div></td><td class="commentsblocktd"><div class="commentsblock"><iframe src="http://www.facebook.com/plugins/comments.php?href=http://infopark.com.ua/sites/default/files/styles/media_gallery_large/public/<?php echo substr($image->uri, 9); ?>" scrolling="no" frameborder="0" style="border:none; width:100%;  height:230px"></iframe></div></td></tr></table></div></div></div>'
		                                    },
		                                    'href'	: 'http://infopark.com.ua/sites/default/files/styles/media_gallery_large/public/<?php echo substr($image->uri, 9); ?>',
		                                    'title'	: '<?php echo $image->media_title_value; ?>',
		                                    wrapCSS: "gallery_css_class"
		                                },
		
		
		               <?php  endforeach; ?>
		
		               				], {
							helpers : {
								thumbs : {
									width: 75,
									height: 50
								}
							}
						});
					});
		
		                });
		             </script>
		         <?php endforeach;
		
		         ?>
		
		
		        <?php foreach ($gallerys_list as $gallery) :
		
                            
		              echo gallery_view_prev($gallery->nid);
                              
		              endforeach;
		
		        endforeach;
		        ?>
			    </div>
               
		<div class="placedescription">
                    <div class="event_social"><?=social_plugings();?></div>
                        <?php if (isset($content['field_event_description']['#items'][0]['value'])) : ?>
                            <?php echo nl2br($content['field_event_description']['#items'][0]['value']); ?>
                        <?php endif; ?>
                </div>
                    
           <?/*<div class="clearfix share">
                <div class="pull-right">       
                    <!-- AddThis Button BEGIN -->
                    <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
                    <a class="addthis_button_preferred_1"></a>
                    <a class="addthis_button_preferred_2"></a>
                    <a class="addthis_button_preferred_3"></a>
                    <a class="addthis_button_preferred_4"></a>
                    <a class="addthis_button_compact"></a>
                    <a class="addthis_counter addthis_bubble_style"></a>
                    </div>
                    <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
                    <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5065df4b159981b7"></script>
                    <!-- AddThis Button END -->
                </div>
           </div>*/?>    

		</div>
    </div>
	
<?
#sites/modules/advert/advert_compromise.inc
#echo _fb_vk_comments();
echo _spec_event_related($node->field_related['und'][0]['value']);
/*
?>	
<ul class="com_tabs"><li class="tabfb" onclick="sw_com('fb')">FB</li><li class="tabvk" onclick="sw_com('vk')">VK</li></ul>
<div class="fb com_box"><div class="fb-comments" data-href="http://infopark.com.ua<?php echo $_SERVER['REDIRECT_URL']; ?>" data-num-posts="5" data-width="300"></div></div>
<div class="vk com_box">
<!-- Put this div tag to the place, where the Comments block will be -->
<div id="vk-comments"></div></div>
<script type="text/javascript">
VK.Widgets.Comments("vk-comments", {limit: 10, width: "auto", attach: "*"});


jQuery(document).ready(function() {

//comments init
jQuery('.vk').hide();
jQuery('.tabfb').addClass("active_tab");


});
</script>*/

?>      
<!--script type="text/javascript" src="/misc/blur.js"></script>   


<script>
jQuery(document).ready( function() {
    jQuery('#masonry').css('background-image','url('+jQuery('.squareimg').attr('src')+')');        

   
   jQuery('#masonry').blurjs({
        source: 'body',
        radius: 300,
        overlay: 'rgba(0, 0, 0, .8)'
    });
});
    
</script-->        
<?php if (!$page): ?>
    </article>
<?php endif; ?>
<?php endif; ?>